ndp: Allow NS loopback for master iface
authorHaoyi Ci <[email protected]>
Thu, 2 Oct 2025 08:14:05 +0000 (16:14 +0800)
committerÁlvaro Fernández Rojas <[email protected]>
Fri, 3 Oct 2025 05:37:28 +0000 (07:37 +0200)
commitf0d855358b86a36efbfeb5a9de5a1d2a4d9d80fe
tree4549ae4350cc598f70df34453edac4610adb4689
parentb14cf98c914d8582f18c7b263814797366fa185d
ndp: Allow NS loopback for master iface

This commit modifies handle_solicit() in ndp.c to correct IPv6 relay
handling of Neighbor Solicitation (NS) requests when no upstream
solicitation is received.

Background: In IPv6 relay mode, odhcpd discovers local devices only upon
receiving upstream NS packets. If no upstream NS arrives (e.g. because the
upstream router’s neighbor cache is still valid or no solicitation was
ever sent), OpenWrt may attempt neighbor resolution via the master (WAN)
interface instead of the LAN, leaving local devices undiscoverable and
breaking connectivity.

- When an NS packet is sent by the host's master interface, do not
  immediately return; instead continue searching slave interfaces for the
  target neighbor.
- When odhcpd responds to NS packets, add a check to prevent replying to
  NS packets that were sent by the host itself.

Signed-off-by: Haoyi Ci [email protected]
Link: https://github.com/openwrt/odhcpd/pull/240
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
src/ndp.c